<h2>Search Results</h2>
<?php

// Turn off all error reporting - production environment
error_reporting(0);

// Report all PHP errors (see changelog) - development environment
//error_reporting(E_ALL);


$keyword = $_POST['keyword'];
mysql_connect("localhost","root","");
mysql_select_db('noc');
$search = mysql_query("select * from `news` where `news_title` like '%$keyword%' ");
if ( mysql_num_rows($search) > 0) {
    while($search_result = mysql_fetch_assoc($search) ) {  ?>

<div class="post">


    <a href ="index.php?page=single_news&news_id=<?php echo $search_result['id'];?>" > <h4><?php echo $search_result['news_title'];?></h4> </a>

    <p align="justify">
                <?php echo substr($search_result['content'],0,100);?>
    </p>


</div>


        <?php } } else {
    echo "No matcing news found!!!";
}
exit;
?>